Add docs for experimental live collections#11782
Conversation
✅ Deploy Preview for astro-docs-2 ready!
To edit notification comments on pull requests, go to your Netlify project configuration. |
Lunaria Status Overview🌕 This pull request will trigger status changes. Learn moreBy default, every PR changing files present in the Lunaria configuration's You can change this by adding one of the keywords present in the Tracked Files
Warnings reference
|
sarah11918
left a comment
There was a problem hiding this comment.
Looking really great, Matt! 🙌
Just left some broad stroke comments after reading through for a first pass with some comments!
| - The error type defined by the loader (if it returned an error) | ||
| - An `AstroError` for schema validation failures or uncaught errors thrown in the loader | ||
|
|
||
| ```astro |
There was a problem hiding this comment.
Just noting here that we want to make all code blocks copy/paste and it's working code. We try not to put multiple options in a code sample that would make it not run as-is.
There's a lot going on in this whole snippet. Can ALL of it happen together in a working function? e.g. "throw an Astro error or handle it yourself" If these can't be done together, then instead one of them could be commented out entirely e.g.
// Or handle errors yourself
// return Astro.redirect('/500');
And, the same goes for e.g. defining entries in multiple places. I know it's convenient to throw everything in one block, but I think we might need another pattern here if this, as a whole, isn't functioning code.
src/content/docs/en/reference/experimental-flags/live-content-collections.mdx
Outdated
Show resolved
Hide resolved
src/content/docs/en/reference/experimental-flags/live-content-collections.mdx
Outdated
Show resolved
Hide resolved
src/content/docs/en/reference/experimental-flags/live-content-collections.mdx
Outdated
Show resolved
Hide resolved
src/content/docs/en/reference/experimental-flags/live-content-collections.mdx
Outdated
Show resolved
Hide resolved
src/content/docs/en/reference/experimental-flags/live-content-collections.mdx
Outdated
Show resolved
Hide resolved
src/content/docs/en/reference/experimental-flags/live-content-collections.mdx
Show resolved
Hide resolved
Co-authored-by: Sarah Rainsberger <5098874+sarah11918@users.noreply.github.com>
sarah11918
left a comment
There was a problem hiding this comment.
2nd pass! This is looking great and probably doesn't require anything more than a Yan review after this! Would be perfectly happy with that state! 🙌
src/content/docs/en/reference/experimental-flags/live-content-collections.mdx
Outdated
Show resolved
Hide resolved
src/content/docs/en/reference/experimental-flags/live-content-collections.mdx
Outdated
Show resolved
Hide resolved
src/content/docs/en/reference/experimental-flags/live-content-collections.mdx
Outdated
Show resolved
Hide resolved
src/content/docs/en/reference/experimental-flags/live-content-collections.mdx
Outdated
Show resolved
Hide resolved
src/content/docs/en/reference/experimental-flags/live-content-collections.mdx
Outdated
Show resolved
Hide resolved
src/content/docs/en/reference/experimental-flags/live-content-collections.mdx
Outdated
Show resolved
Hide resolved
src/content/docs/en/reference/experimental-flags/live-content-collections.mdx
Outdated
Show resolved
Hide resolved
src/content/docs/en/reference/experimental-flags/live-content-collections.mdx
Outdated
Show resolved
Hide resolved
src/content/docs/en/reference/experimental-flags/live-content-collections.mdx
Outdated
Show resolved
Hide resolved
src/content/docs/en/reference/experimental-flags/live-content-collections.mdx
Outdated
Show resolved
Hide resolved
Co-authored-by: Sarah Rainsberger <5098874+sarah11918@users.noreply.github.com>
|
Will note on Talking and Doc'ing that someone suggested documenting the |
yanthomasdev
left a comment
There was a problem hiding this comment.
Great work! A few nits from me 🙌
src/content/docs/en/reference/experimental-flags/live-content-collections.mdx
Outdated
Show resolved
Hide resolved
src/content/docs/en/reference/experimental-flags/live-content-collections.mdx
Outdated
Show resolved
Hide resolved
|
|
||
| const { entry, error } = await getLiveEntry('products', '123'); | ||
| if (error) { | ||
| // This could be a network error, not found error, or Zod validation error |
There was a problem hiding this comment.
| // This could be a network error, not found error, or Zod validation error | |
| // This could be a network error, not found error or Zod validation error |
There was a problem hiding this comment.
I've had it hammered into me to use Oxford comma for Astro stuff, so isn't this right as it stands? I think I'll reword this anyway though
There was a problem hiding this comment.
Yes, I'm not sure why Yan would remove an Oxford comma. Chalk it up to exam week brain, unless there's something I'm missing? 😄
So fine as is, I think!
There was a problem hiding this comment.
It's probably the thing I find hardest to remember when writing Astro stuff! Even harder than using US spelling, because at least that's obvious.
Co-authored-by: Yan <61414485+yanthomasdev@users.noreply.github.com>
…collections.mdx Co-authored-by: Yan <61414485+yanthomasdev@users.noreply.github.com>
Description (required)
Adds docs for live collections. It's not certain which release this will be in, so I've not included the
sincevalue and won't add this to a milestone just yetRelated issues & labels (optional)